package com.designpatterns.templatemethod.hook;

/**
 * @author Brook
 */
public abstract class CaffeineBeverageWithHook {

    public void prepareRecipe() {
        boilWater();
        brew();
        pourInCup();
        if(customerWantsCondiments()){
            addCondiments();
        }
    }

    /**
     * name
     */
    abstract void brew();

    /**
     * name
     */
    abstract void addCondiments();

    private void boilWater() {
        System.out.println("Boil water");
    }

    public void pourInCup() {
        System.out.println("pour into cup");
    }

    public boolean customerWantsCondiments() {
        return true;
    }
}
